import type { AxiosPromise } from 'axios'
import request from '@/utils/request'

export interface UserInfo {
  id: number | string
  username: string
  nickName: string
  avatar: string
  routerPath: string
  permissions: string[]
  roles: string[]
}

// export function getUserInfoApi() {
//   return useGet<UserInfo>('/user/info')
// }

export function getUserInfoApi(): AxiosPromise {
  return request({
    url: '/system/user/getInfo',
    method: 'get',
  })
}

/**
 * 注销
 */
export function logoutUser() {
  return request({
    url: '/auth/logout',
    method: 'post',
  })
}
